module TagHelper

  def sort_by(name)
    params[:order] == name.to_s ? "select" : ''
  end
  
  def tag_name(tag)
    tag.gsub(/\(\d+\)$/, '')
  end
  
  def tag_qty(tag)
    tag.gsub(/(.+)(\(\d+\))$/, '\2')
  end
end
